package com.zxy.ziems.server.monitor.pojo.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zxy.ziems.server.utils.tree.TreeInterface;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * 设备列表树
 *
 * @author 10348359
 * @create 2024-04-12 9:31
 */

@Data
@Builder
public class MonitorTreeVO implements TreeInterface<MonitorTreeVO> {

    /**
     * 主键
     */
    private String id;
    /**
     * 设备id
     */
    private String deviceId;

    /**
     * 名称
     */
    private String name;

    /**
     * 父节点
     */
    @JsonIgnore
    private String parentId;


    static public Integer GROUP_TYPE = 1;
    static public Integer DEVICE = 2;

    /**
     * 1是分组 2是设备
     */
    private Integer type;

    /**
     * 子列表
     */
    private List<MonitorTreeVO> children;

    @Override
    public String _getTreeCode() {
        return id;
    }

    @Override
    public String _getTreeParentCode() {
        return parentId;
    }

    @Override
    public void _setTreeChildren(List<MonitorTreeVO> list) {
        setChildren(list);
    }

    @Override
    public List<MonitorTreeVO> _getTreeChildren() {
        return children;
    }
}
